<?php
include("../includes/common.php");
if($islogin2==1){}else exit("<script language='javascript'>window.location.href='./login.php';</script>");
include './head.php';
/**********用户ID获取***************/ 
$uid=$rs=$DB->query("select * from pay_user WHERE name={$pid}");
 foreach($uid as $res){
 $usid=$res['id'];
}
/***********获取转账数据总数**************/
$numrows=$DB->query("SELECT count(*) from pay_userpay WHERE pid={$usid}")->fetchColumn();
/***********结算数据获取************* 只获取最近3条*/
$list=$DB->query("SELECT * FROM pay_settle WHERE pid={$usid} order by id desc limit 3")->fetchAll();
/***********公告数据获取**************/
$uesrs=$DB->query("SELECT * FROM `pay_cement` WHERE `active` = 0 order by time desc limit 3")->fetchAll();
/**********广告数据获取***************/
$gong=$DB->query("SELECT * FROM `pay_cement` WHERE `active` = 1 order by time desc limit 10")->fetchAll();
/**********邀请数据获取***************/
$invite=$DB->query("SELECT * from pay_invite WHERE uid={$usid}")->rowCount();

//普通会员支付宝费率
$money_rate_alipay=100-$conf['money_rate_alipay'];
//普通会员微信费率
$money_rate_wxpay=100-$conf['money_rate_wxpay'];
//普通会员QQ费率
$money_rate_qqpay=100-$conf['money_rate_qqpay'];
//黄金会员费率
$money_rate_vip=100-$conf['money_rate_vip'];
//砖石会员费率
$money_rate_svip=100-$conf['money_rate_svip'];
//获取订单总数
$orders=$DB->query("SELECT count(*) from pay_order WHERE pid={$usid}")->fetchColumn();
$lastday=date("Y-m-d",strtotime("-1 day")).' 00:00:00';
$today=date("Y-m-d").' 00:00:00';
//今日收入获取
$order_today=$DB->query("SELECT sum(money) from pay_order where pid={$usid} and status=1 and endtime>='$today'")->fetchColumn();
//昨日收入获取
$order_lastday=$DB->query("SELECT sum(money) from pay_order where pid={$usid} and status=1 and endtime>='$lastday' and endtime<'$today'")->fetchColumn();
//已结算数据获取
$rs=$DB->query("SELECT * from pay_settle where pid={$usid} and status=1");
//昨日收入获取默认0
//$order_lastday=0;
//今日收入获取默认0
//$order_today=0;
//已结算获取默认0
$settle_money=0;
/*************************/
$max_settle=0;
$chart='';
$i=0;
/*************************/
/********已经结算数据获取***********/

while($row = $rs->fetch())
{
  $settle_money+=$row['money'];
  if($row['money']>$max_settle)$max_settle=$row['money'];
  if($i<9)$chart.='['.$i.','.$row['money'].'],';
  $i++;
}
$chart=substr($chart,0,-1);
/********已经结算数据获取***********/
include './huan.php';
?>
<?php include './foot.php';?>